{% extends "base.html" %}
{% block title %}{{task}}{% endblock %}
{% block head %}
{{ super() }}
{% endblock %}
{% block content %}
<div id="navigation">
    <ul>
        <li><a href="/triggers">Back</a></li>
        <li><a href="javascript:void(0);" onclick="deleteTrigger('$title');">Delete Trigger</a></li>
    </ul>
</div>
<div id="content">
    <h2>Trigger: {{trigger}}</h2>
        <p>To modify the trigger, edit the information below.
    <form name="newTrigger" id="newTrigger" method="post" action="/triggers">
        <p><input type="hidden" name="name" value="$title" />
        <p>Trigger type: <br><select name="type" id="type" onchange="addInput(document.newTrigger.type.value);" >
        <option value="">None</option>
        {% if trigger!=None and trigger[0]=="Periodic" %}
            <option value="Periodic" selected="selected">Periodic</option>
        {% else %}
            <option value="Periodic">Periodic</option>
        {% endif %}
        </select>
        <div id="dynamic"></div>
        <p><input name="save" type="submit" value="Save" />
    </form>
{% if included != None and included|length > 0 %}
    <h3>Trigger included in jobs:</h3>
    <ul>
    {% for job in included %}
        <li><a href="/jobs/{{job}}">{{job}}</a>
    {% endfor %}
    </ul>
{% endif %}
</div>
    <script type="text/javascript">
    {% if trigger != None %}
        addInput("$trigger[0]", "$trigger[1]");
    {% endif %}
    </script>
{% endblock %}